/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.ProfissionalDAO;
import model.TipoUsuarioDAO;

/**
 *
 * @author rosana
 */
public class TrataPreCadastroUsuario extends Comando {

    @Override
    public void executar(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, IOException, ServletException {
    
    response.setContentType("text/html;charset=UTF-8");

        ProfissionalDAO profdao = new ProfissionalDAO();
        TipoUsuarioDAO tipodao = new TipoUsuarioDAO();
                
        HttpSession session = request.getSession(false);
        session.setAttribute("listaProfissionais", profdao.pesquisar());
        session.setAttribute("listaTipos", tipodao.pesquisar());
        response.sendRedirect("cadastraUsuario.jsp");
    }
    
}
